package com.osce.score.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.csce.domain.entity.score.ScoreExExamTime;
import org.apache.ibatis.annotations.MapKey;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 考试时间段Mapper接口
 *
 * @author zzx
 * @since 2023-09-05
 */
@Repository
public interface ScoreExExamTimeMapper extends BaseMapper<ScoreExExamTime> {

    /**
     * 查询考试时间段
     *
     * @param id 考试时间段主键
     * @return 考试时间段
     */
    ScoreExExamTime selectScoreExExamTimeById(Long id);

    /**
     * 查询考试时间段列表
     *
     * @param scoreExExamTime 考试时间段
     * @return 考试时间段集合
     */
    List<ScoreExExamTime> selectScoreExExamTimeList(ScoreExExamTime scoreExExamTime);

    List<ScoreExExamTime> selectScoreExExamTimeListByExamId(Long examId);

    /**
     * 新增考试时间段
     *
     * @param scoreExExamTime 考试时间段
     * @return 结果
     */
    int insertScoreExExamTime(ScoreExExamTime scoreExExamTime);

    int batchInsertScoreExExamTime(List<ScoreExExamTime> scoreExExamTimes);

    /**
     * 修改考试时间段
     *
     * @param scoreExExamTime 考试时间段
     * @return 结果
     */
    int updateScoreExExamTime(ScoreExExamTime scoreExExamTime);

    /**
     * 删除考试时间段
     *
     * @param id 考试时间段主键
     * @return 结果
     */
    int deleteScoreExExamTimeById(Long id);

    /**
     * 批量删除考试时间段
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    int deleteScoreExExamTimeByIds(Long[] ids);

    int deleteScoreExExamTimeByExamIds(Long[] ids);

    int deleteScoreExExamTimeByExamId(Long id);

    @MapKey("id")
    Map<Long, ScoreExExamTime> selectScoreExExamTimeToMapByIds(Long[] ids);
}
